<template>
  <el-dialog :visible.sync="visible" :close-on-click-modal="false" center @close="onClose">
    <template v-slot:title>
      <h2>【{{ examName }}】所有考生得分综合分析表</h2>
    </template>
    <data-table
      v-if="apiSetting.data.paperId"
      ref="dtb"
      :api-setting="apiSetting"
      pagination
    >
      <el-table-column
        fixed
        prop="userName"
        width="100"
        label="考生信息"
        show-overflow-tooltip
      />
      <el-table-column
        prop="organizeName"
        label="班级名称"
        show-overflow-tooltip
      />
      <el-table-column
        prop="totalScore"
        label="总分"
        width="80"
        show-overflow-tooltip
      />
      <el-table-column
        prop="score"
        label="学生成绩"
        width="80"
        show-overflow-tooltip
      />
      <el-table-column
        prop="scoreProportion"
        label="得分率"
        width="80"
        show-overflow-tooltip
      />
    </data-table>
  </el-dialog>
</template>

<script>
import dialog from "@/mixins/component/dialog";

export default {
  name: "score",
  mixins: [dialog],
  data() {
    return {
      apiSetting: {
        method: "post",
        url: "/sys/examAnalysis/getScoreAnalysis",
        data: {
          paperId: 0,
          examId: 0
        }
      },
      examName: ""
    };
  },
  methods: {
    setParams(paperId, examId, reload = true) {
      this.apiSetting.data.paperId = paperId;
      this.apiSetting.data.examId = examId;
      if (this.$refs.dtb && reload) {
        this.$refs.dtb.loadData();
        return;
      }
    }
  }
};
</script>

<style scoped></style>
